<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>确定课程订单</title><!--从视频详情页 点击立即购买进入-->
<link href="<?php echo TEMPLATES_PATH;?>/css/home_cart.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="<?php echo TEMPLATES_PATH;?>/css/pintuer.css">
<link rel="stylesheet" href="<?php echo TEMPLATES_PATH;?>/css/university.css" />
</head>
<body>
<div class="lessonOrder padding">
	<div class="lesson-detail bg-white padding radius-big"> 
		
		
    	<a href="index.php?act=university_detail&op=index&study_cat_id=<?php echo $output['study_cat_id']?>&study_id=<?php echo $output['study_id']?>" class="clearfix"><!--链接到视频详情页-->
        	<span class="x4 border lesson-img">
        		<img src="<?php echo universityModel::getLesson_photo($output['study_id'])?>" alt="" class="layout border-none layout">
                <div class="bg-back"></div>
            </span>
            <span class="x8 padding-left">
            	<h5 class="lesson-name margin-bottom"><?php echo universityModel::getStudy_name($output['study_id'])?></h5>
                <span class="lesson-price ">学习费:<span class=" text-red">￥<?php echo universityModel::getStudy_price($output['study_id'])?></span></span>
            </span>
        </a>
    </div>
    <div class="margin-top bg-white text-center clearfix">
        <div class="float-left padding">需支付：<span class="text-red ">￥<?php echo universityModel::getStudy_price($output['study_id'])?></span></div>
        <a href="javascript:void(0);" <?php echo ' onclick="show_window(\'ent_pay_pwd\');" ';?> class="padding float-right bg-red text-white radius-big ">确认支付</a>
 <!--<div class="pay_btn_area"><a href="javascript:void(0);" <?php echo ' onclick="show_window(\'ent_pay_pwd\');" ';?> class="pay_btn">确认支付</a></div>-->
    </div>
    <div id="ent_pay_pwd" class="ent_pay_pwd">
      <div class="close_ent">验证支付密码<a href="javascript:void(0);" onclick="close_ent();"></a></div>
      <div class="ent_pay_main">
      	<input type="password" class="text" autocomplete="off" name="payword" id="payword" value="" placeholder="请输入交易支付密码">
        <span id="error_pwd"></span>
        <div class="enter">
          <a href="javascript:void(0);" class="link" onclick="act()">确认</a>
          <a href="javascript:void(0);" class="link" onclick="window.open('index.php?act=member_index&op=mod_pay_pwd')">设置支付密码</a>
          <a href="javascript:void(0);" class="link" onclick="resetPwd()" style="display:none;" id="find_pay_pwd">找回支付密码</a>
         </div>
      </div>
</div>
</div>
</body>
</html>
<script type="text/javascript">
function act(){
	var pas = $('#payword').val();
	$.post('index.php?act=member_index&op=checkPayPwd',{password:pas},function(date){
		if(date=="true"){
			window.location.href="index.php?act=university_detail&op=lesson_buyOrderDeatil&study_id=<?php echo $output['study_id']?>&study_cat_id=<?php echo $output['study_cat_id']?>";
		}else{
		  $("#error_pwd").text('支付密码验证错误');
		  $('#find_pay_pwd').show();  
		}
	},'text');
}

function resetPwd(){
	$.ajax({
		type:'POST',
		url:'index.php?act=member_index&op=resetPayPwd',
		error:function(html){
			alert(html.msg);
		},
		success:function(html){
			alert(html.msg);
		},
		dataType:'json'
	});
}

//支付检测
function check(){
    <?php if($full_banlancepay_pay){?>
    show_window('ent_pay_pwd');
    return false;
    <?php }?>

	var $payment_checked = $("input[name='payment_id']:checked");

	if($payment_checked.val() > 0){
		$('#goto_pay').submit();
	}else{
	    alert('请选择支付方式');
	}
}

function close_ent(){
	$('#ent_pay_pwd').hide();
	$('#area_back').hide();
}

//显示遮罩层
function show_window(obj){
	$('#'+obj).show();
	$(window).bind('resize scroll',function(e){
		$('#'+obj).css({
			left: ($(window).width() - $('#'+obj).outerWidth())/2+ $(document).scrollLeft(),
			top: ($(window).height() - $('#'+obj).outerHeight())/2+ $(document).scrollTop()
		});
	});
	$('#'+obj).css({
		left: ($(window).width() - $('#'+obj).outerWidth())/2+ $(document).scrollLeft(),
		top: ($(window).height() - $('#'+obj).outerHeight())/2+ $(document).scrollTop()
	});
	
	if($('#area_back').length<=0){
		$('body').append($('<div>')
			.attr('id','area_back')
			.css({
				position:'absolute',
				'z-index':'9999',
				top:0,
				left:0,
				margin:0,
				background:'#666'
		}));
		$('#area_back').css({
			width:$(document).width(),
			height:$(document).height(),
			opacity:'0.8'
		});
	}
	$('#area_back').show();
}


</script>
